#define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
#include <string>
#include <vector>
using namespace std;
#include "pr_queue.h"

using namespace my_queue;

class Date
{
public:
	Date(int year = 1900, int month = 1, int day = 1)
		: _year(year)
		, _month(month)
		, _day(day)
	{}
	bool operator<(const Date& d)const
	{
		return (_year < d._year) ||
			(_year == d._year && _month < d._month) ||
			(_year == d._year && _month == d._month && _day < d._day);
	}
	bool operator>(const Date& d)const
	{
		return (_year > d._year) ||
			(_year == d._year && _month > d._month) ||
			(_year == d._year && _month == d._month && _day > d._day);
	}
	friend ostream& operator<<(ostream& _cout, const Date& d)
	{
		_cout << d._year << "-" << d._month << "-" << d._day;
		return _cout;
	}
private:
	int _year;
	int _month;
	int _day;
};

int main()
{
	//my_queue::priority_queue<int, vector<int>, my_queue::greater<int>> que;
	/*que.push(1);
	que.push(0);
	que.push(5);
	que.push(2);
	que.push(1);
	que.push(7);

	while (!que.empty())
	{
		printf("%d ", que.top());
		que.pop();
	}*/

	struct __date_less
	{
		bool operator()(const Date* d1, const Date* d2)
		{
			return *d1 < *d2;
		}
	};
	priority_queue <Date*, vector<Date*>, __date_less> que;

	/*que.push(Date(2018, 10, 29));
	que.push(Date(2018, 10, 28));
	que.push(Date(2018, 10, 30));
	cout << que.top() << endl;*/

	

	que.push(new Date(2018, 10, 29));
	que.push(new Date(2018, 10, 28));
	que.push(new Date(2018, 10, 30));
	cout << *(que.top()) << endl;
	return 0;
}
